/**
 * Created by zzh on 2022/9/29.
 */
define(function (require, exports, module) {
    "use strict";

    const request = axios.create({
        timeout: 1000 * 50,
        withCredentials: true,
        headers: {
            'Content-Type': 'application/json; charset=utf-8'
        }
    })

    /**
     * 请求拦截
     */
    request.interceptors.request.use(config => {
        // do something
        return config
    }, error => {
        return Promise.reject(error)
    })

    /**
     * 响应拦截
     */
    request.interceptors.response.use(response => {
        // do something
        return response
    }, error => {
        return Promise.reject(error)
    })

    module.exports = request;
});